package com.example.cardgame

import android.content.Intent
import android.os.Bundle
import android.widget.Button
import android.widget.EditText
import androidx.activity.enableEdgeToEdge
import androidx.appcompat.app.AppCompatActivity
import androidx.core.view.ViewCompat
import androidx.core.view.WindowInsetsCompat

class ModifyActivity : AppCompatActivity() {
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        enableEdgeToEdge()
        setContentView(R.layout.activity_modify)
        ViewCompat.setOnApplyWindowInsetsListener(findViewById(R.id.main)) { v, insets ->
            val systemBars = insets.getInsets(WindowInsetsCompat.Type.systemBars())
            v.setPadding(systemBars.left, systemBars.top, systemBars.right, systemBars.bottom)
            insets
        }

        val name:EditText=findViewById(R.id.name)
        val phone: EditText=findViewById(R.id.Email)
        val gender: EditText=findViewById(R.id.gender)
        val save: Button=findViewById(R.id.save)

        save.setOnClickListener{
            val intent=Intent()
            val str=name.text.toString()+","+phone.text.toString()+","+gender.text.toString()
            intent.putExtra("THIRD_MSG",str.toString())
            setResult(2,intent)

        }
    }
}